# This section includes base Calico installation configuration.
# For more information, see: https://docs.tigera.io/calico/latest/reference/installation/api#operator.tigera.io/v1.Installation
apiVersion: operator.tigera.io/v1
kind: Installation
metadata:
  name: default
spec:
  # Configures Calico networking.
  calicoNetwork:
    # Note: The ipPools section cannot be modified post-install.
    ipPools:
    - blockSize: {{ calico_blockSize }}
      cidr: {{ cluster_cidr }}
      encapsulation: {{ calico_encapsulation }}
      natOutgoing: {{ calico_natOutgoing }}
      nodeSelector: {{ calico_nodeSelector }}
    nodeAddressAutodetectionV4:
      interface: {{ calico_iface  }}
    linuxDataplane: {{ 'BPF' if calico_ebpf else 'Iptables' }}

---

# This section configures the Calico API server.
# For more information, see: https://docs.tigera.io/calico/latest/reference/installation/api#operator.tigera.io/v1.APIServer
apiVersion: operator.tigera.io/v1
kind: APIServer
metadata:
  name: default
spec: {}

{% if calico_ebpf %}
---
kind: ConfigMap
apiVersion: v1
metadata:
  name: kubernetes-services-endpoint
  namespace: tigera-operator
data:
  KUBERNETES_SERVICE_HOST: '{{ apiserver_endpoint }}'
  KUBERNETES_SERVICE_PORT: '6443'
{% endif %}
